

#!/bin/bash

cat > /etc/apt/sources.list << EOF
deb http://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb http://mirrors.aliyun.com/debian-security/ bullseye-security main
deb-src http://mirrors.aliyun.com/debian-security/ bullseye-security main
deb http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
EOF
apt-get update &&
apt-get -y install inetutils-ping iproute2 net-tools vim psmisc procps openssh-server  unzip zip &&
mkdir -p /var/run/sshd
cat >> /etc/ssh/sshd_config << EOF
PermitRootLogin yes
PasswordAuthentication yes
EOF
/usr/sbin/sshd

---------------------
https://blog.csdn.net/inrgihc/article/details/109001886

docker volume create volume-data
docker volume create volume-mvc
docker volume create volume-nginx
docker volume create volume-nginx-log
docker volume ls

# docker run 如果不进入终端，最好不要家winpty，会导致 -v 数据卷名:/容器路径 错误

ssh - p 2222 root@172.17.0.2

winpty docker run - d - p 2222:22--name php72 - 1--network dev_network   php:7.2.34 - fpm

--------------------------
docker stop {
    php72 - 1,nginx - 1} && docker rm {
    php72 - 1,nginx - 1}

docker network create dev_network

docker run -d -p 2222:22 --name php72 --privileged=true --network dev_network  \
-v volume-mvc:/mvc \
-v volume-data:/data \
-v /web/aliyun/kaikeba/nginx:/etc/nginx/conf.d \
-v volume-nginx-log:/var/log/nginx \
php:7.2.34-fpm

docker run -d -p 80:80 --name nginx --privileged=true --network dev_network \
--volumes-from  php72 \
nginx:1.21.4

=============

docker run - d - p 2222:22--name php72--privileged = true--network dev_network  \
-v volume - mvc:/mvc \
-v volume - data:/data \
-v "E:\web/aliyun/kaikeba/nginx":/etc/nginx/conf.d \
-v volume - nginx - log:/var/log / nginx \
php:7.2.34 - fpm

docker run - d - p 80:80--name nginx--privileged = true--network dev_network \
--volumes - from  php72 \
nginx:1.21.4



docker cp "E:\mvc/." php72 - 1:/mvc
docker cp - a "E:\data/." php72 - 1:/data


使用 docker - sync 调整 Docker for Mac 磁盘性能
                               https://blog.csdn.net/aggresss/article/details/81633288


    使用 docker run - v 数据卷:docker目录 这种形式才不会慢，但是使用这种形式就要开放一个22口后然后用工具同步


--------------------------

docker run - d - p 2222:22--name php72 - 1--privileged = true--network dev_network  \
-v volume - data:/data php:7.2.34 - fpm


docker run - d - p 90:80 - p 2223:22--name nginx - 1--privileged = true--network dev_network \
-v "E:\web/aliyun/kaikeba/nginx":/etc / nginx / conf . d \
--volumes - from php72 - 1 \
nginx:1.21.4







docker run - p 90:80 - p 2223:22--name nginx - 1--privileged = true--network dev_network \
-v "E:\web/aliyun/kaikeba/nginx":/etc / nginx / conf . d \
--volumes - from php72 - 1 \
nginx:1.21.4


docker run - p 90:80 - p 2223:22--name nginx - 1--privileged = true--network dev_network \
-v "E:\mvc":/mvc:cached \
-v "E:\web/aliyun/kaikeba/nginx":/etc / nginx / conf . d \
--volumes - from php72 - 1 \
nginx:1.21.4


--------------------------
Docker Desktop for Windows（WSL 2 方式）数据卷位置和访问
https://blog.csdn.net/u013568040/article/details/119899675

docker stop php72 - 1 && docker rm php72 - 1



winpty docker run - d - p 90:80 - p 2223:22--name nginx - 1--network dev_network \
--mount type = bind,src =/e / web / aliyun / kaikeba / nginx /,target =/etc / nginx / conf . d \
nginx:1.21.4




https://hub.docker.com/search?q=sshd&type=image
docker run - d - p 2222:22 \
  -e SSH_ENABLE_ROOT = true \
  -e SSH_ENABLE_PASSWORD_AUTH = true \
    panubo / sshd


docker 数据持久化及配置Volume和mount说明
https://blog.csdn.net/yangshihuz/article/details/103976407
Docker数据卷挂载命令volume(-v)与mount的区别
https://blog.csdn.net/inrgihc/article/details/109001886

winpty docker run - d - p 2203:22--name php72 - 1--network dev_network \
--mount type = volume,source = volume_nginx,target =/var/log / nginx \
--mount type = volume,source = volume_nginx_conf,target =/etc / nginx / conf . d \
--mount type = volume,source = volume_data,target =/data \
php:7.2.34 - fpm


winpty docker run - d - p 90:80--name nginx - 1--network dev_network \
--mount type = bind,src =/e / mvc,target =/mvc \
--mount type = bind,src =/e / web / aliyun / kaikeba / nginx /,target =/etc / nginx / conf . d \
--mount type = bind,src =/e / data,target =/data  nginx:1.21.4

winpty docker run - d - p 89:80--name nginx - 1--network dev_network \
--mount type = bind,src = "E:\mvc",target =/mvc \
--mount type = bind,src = "E:\web/aliyun/kaikeba/nginx",target =/etc / nginx / conf . d \
--mount type = bind,src = "E:\data",target =/data  nginx:1.21.4




winpty docker run - d--name php72 - 1--network dev_network--volumes - from nginx - 1 php:7.2.34 - fpm



docker stop {
    php72 - 1,nginx - 1} && docker rm {
    php72 - 1,nginx - 1}




8讲Docker | Docker容器初体验:   https://juejin.cn/post/6844904095682134030



E:\web\aliyun\kaikeba\nginx\modongxiao . conf


-------------------------------------------------------------
winpty docker run - d - p 80:80 - p *:22--name nginx--network dev_network \
-v "E:\mvc":/mvc:cached \
-v "E:\web/aliyun/kaikeba/nginx":/etc / nginx / conf . d:cached \
-v "E:\data":/data:cached \
-v "E:\web/nginx/logs":/var/log / nginx:cached  nginx:1.21.4


winpty docker run - d--name php72--network dev_network \
-v "E:\mvc":/mvc:cached \
-v "E:\web/aliyun/kaikeba/nginx":/etc / nginx / conf . d:cached \
-v "E:\data":/data:cached \
php:7.2.34 - fpm




docker中的php 链接mysql缺少驱动解决办法：  https://blog.csdn.net/ltgsoldier1/article/details/105515347

docker exec - it 23f25c24d6e8 bash
#进入目录bin
cd /usr/local/bin
#安装扩展pdo_mysql
    ./docker-php-ext-install pdo_mysql
#安装扩展mysql
    ./docker-php-ext-install mysql
#安装扩展mysqli
    ./docker-php-ext-install mysqli

#重启容器
docker restart 23f25c24d6e8



http://blog.sina.com.cn/s/blog_9b9132fd0102xagc.html
apt - get install openssh - server - y
https://blog.csdn.net/haoxiaoyong1014/article/details/80004789
法：yum install initscripts

service ssh start

service ssh restart
cat / etc / ssh / sshd_config

root@c92cb80c5827:/# passwd
new password:
Retype new password:
passwd: password updated successfully

 ssh - p 2222 root@127.0.0.1

https://blog.csdn.net/imlsz/article/details/103927700
1、设置root密码
sudo passwd root
2、设置 ssh
 mkdir - p /var/run / sshd
cat / etc / ssh / sshd_config
Port 22
#AddressFamily any

PermitRootLogin yes
PasswordAuthentication yes
systemctl restart sshd
/ usr / sbin / sshd




winpty docker run--rm - d - p 87:80 - p 2201:22--name nginx1--network dev_network \
-v "E:\mvc":/mvc:cached \
-v "E:\web/aliyun/kaikeba/nginx":/etc / nginx / conf . d:cached \
-v "E:\data":/data:cached \
-v "E:\web/nginx/logs":/var/log / nginx:cached  nginx:1.21.4


winpty docker run--rm - d - p 87:80 - p 2201:22--name nginx1--network dev_network \
-v php - data:/data  nginx:1.21.4

----------------------------